package org.compiere.process;

import java.io.File;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;

import jxl.Workbook;
import jxl.format.Alignment;
import jxl.format.Border;
import jxl.format.BorderLineStyle;
import jxl.format.CellFormat;
import jxl.format.Colour;
import jxl.format.VerticalAlignment;
import jxl.write.Formula;
import jxl.write.Label;
import jxl.write.Number;
import jxl.write.NumberFormats;
import jxl.write.WritableCell;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;

import org.adempiere.exceptions.AdempiereException;
import org.compiere.apps.ADialog;
import org.compiere.model.MAttachmentEntry;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.eevolution.model.X_HR_Department;

import extend.org.compiere.hrm.ExcelCell;
import extend.org.compiere.utils.Util;

public class ReportSex extends SvrProcess {
	
	/** Current context		*/
	private Properties m_ctx;
	/**	 */
	private ProcessInfo pi;
	/** */
	private int HR_Department_ID = 0;
	/** */
	private int HR_Block_ID = 0;
	/** */
	private String path = "";
	/** */
	X_HR_Department department = null;
	/** */
	X_HR_Department block = null;
	/** */
	private List<Object> param = new ArrayList<Object>();

	@Override
	protected void prepare() {

		log.info(" Report Sex ");
		m_ctx = Env.getCtx();
		pi = getProcessInfo();
	
		ProcessInfoParameter[] para = getParameter();
		for (int i = 0; i < para.length; i++)	{
			String name = para[i].getParameterName();
			if (name == null); 
				//
			else if (name.compareTo("HR_Block_ID") == 0 && para[i].getParameter() != null)
				HR_Block_ID = new BigDecimal(Integer.parseInt(para[i].getParameter().toString())).intValue();
			else if (name.compareTo("HR_Department_ID") == 0 && para[i].getParameter() != null)
				HR_Department_ID = new BigDecimal(Integer.parseInt(para[i].getParameter().toString())).intValue();
			else if (name.toLowerCase().endsWith("directory"))
				path = (String)para[i].getParameter();
			else
			{
				log.log(Level.INFO, "Unknown Parameter: " + name);
			}
		}
		
		if(path.isEmpty())
			path = Util.localFilePath;
		else
			path = path + System.getProperty("file.separator");
		
		department = new X_HR_Department(getCtx(), HR_Department_ID, null);
		block = new X_HR_Department(getCtx(), HR_Block_ID, null);	

	}

	@Override
	protected String doIt() throws Exception {
		
		// Types of cells for
		Label label;
		Number number;
		Formula formula;
		// There are checks for a specified pattern
		String templateName = "SampleSex";
		
		//
		MAttachmentEntry entry = Util.getAttachment(pi, m_ctx, templateName);
		if(entry == null)
			throw new AdempiereException(Msg.translate(m_ctx, "NotFoundTemplate")+" "+templateName);
		
		// We define a path to generate
		String fileExtension = entry.getName().substring(entry.getName().lastIndexOf("."),entry.getName().length());
		StringBuffer fullPath = new StringBuffer(path); 
		fullPath.append("List number of women and men").append(fileExtension);
		
		// 
		File templateCopy = new File(fullPath.toString());
		File temporaryFile = entry.getFile(Util.localFilePath+templateName);
		Workbook tableBook = null;
		WritableWorkbook copy = null;
		WritableSheet sheet = null;
		WritableSheet sheet1 = null;
		try {
			tableBook = Workbook.getWorkbook(temporaryFile);
			copy = Workbook.createWorkbook(templateCopy, tableBook);
			sheet = copy.getSheet(0);
			sheet1 = copy.getSheet(1);
		} catch (Exception e) {
			ADialog.error(999, null, "Error tableBook. " + e.getMessage());
		    return "Error tableBook.";
		}

		ExcelCell cellStart =  Util.getCellStart(tableBook,">>");
		
		// Standart style cell
		WritableCellFormat borderStyle = new WritableCellFormat();
		borderStyle.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
		borderStyle.setAlignment(Alignment.CENTRE);
		borderStyle.setVerticalAlignment(VerticalAlignment.CENTRE);
		borderStyle.setWrap(true);
		// Department style cell
		WritableFont fontDepartment = new WritableFont (WritableFont.TIMES, 12, WritableFont.BOLD);
		WritableCellFormat cellDepartment = new WritableCellFormat(fontDepartment);
		cellDepartment.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
		cellDepartment.setAlignment(Alignment.CENTRE);
		cellDepartment.setVerticalAlignment(VerticalAlignment.CENTRE);
		cellDepartment.setBackground(Colour.TAN);
		cellDepartment.setWrap(true);
		// Job style cell
	    WritableCellFormat jobStyle = new WritableCellFormat();
	    jobStyle.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
	    jobStyle.setAlignment(Alignment.LEFT);
	    jobStyle.setVerticalAlignment(VerticalAlignment.CENTRE);
	    jobStyle.setWrap(true);
		// Title style cell
		WritableFont fontTitle = new WritableFont (WritableFont.TIMES, 14, WritableFont.NO_BOLD);
		WritableCellFormat titleStyle = new WritableCellFormat(fontTitle);
		titleStyle.setAlignment(Alignment.CENTRE);
		titleStyle.setVerticalAlignment(VerticalAlignment.CENTRE);
		// Percent format
		WritableFont font = new WritableFont (WritableFont.TIMES, 12, WritableFont.BOLD);
		WritableCellFormat percentf = new WritableCellFormat(font, NumberFormats.PERCENT_INTEGER);
		percentf.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
		percentf.setAlignment(Alignment.CENTRE);
		percentf.setVerticalAlignment(VerticalAlignment.CENTRE);
		// Total style cell
	    WritableFont fontTotal = new WritableFont (WritableFont.TIMES, 14, WritableFont.BOLD);
	    WritableCellFormat totalStyle = new WritableCellFormat(fontTotal);
	    totalStyle.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
	    totalStyle.setAlignment(Alignment.CENTRE);
	    totalStyle.setVerticalAlignment(VerticalAlignment.CENTRE);
	    totalStyle.setBackground(Colour.GRAY_25);
		
	    // header report
	    WritableCell readCell = sheet.getWritableCell(1, 1);
		CellFormat readFormat = readCell.getCellFormat();
		label = new Label(1, 1, sheet.getCell(1, 1).getContents()+Util.getOrgInfo().getDescription(), readFormat);
		sheet.addCell(label);
	    
		// set title
	    if(HR_Department_ID != 0){
	    	label = new Label(0, 2, department.getName(), titleStyle);
	    	sheet.addCell(label);
	    }
	    else if(HR_Block_ID != 0){
	    	label = new Label(0, 2, "Блока "+block.getName(), titleStyle);
	    	sheet.addCell(label);
	    }
		
		Sex[] lines = getValues();
		int col = cellStart.getC(); // offset by the number of first columns
	    int row = cellStart.getR();
	    int rowC = cellStart.getR();
	    int n = 0;
	    int num = 1;
	    int dId = 0; // Departmnet ID
	    int dep = 0;
	    for(int j = row; j < (row+lines.length); j++){
	    	 if(dId != lines[n].getDepartment_id()){
		    	   dId = lines[n].getDepartment_id();
		    	   sheet.insertRow(j+dep);
		    	   sheet.mergeCells(1, j+dep, 2, j+dep);
		    	   sheet.setRowView(j+dep, 600);
		    	   label = new Label(1, j+dep, lines[n].getDepartment(), cellDepartment); 
			       sheet.addCell(label);
			       // Count Dep
			       number = new Number(col+2, j+dep, lines[n].getCntDep(), cellDepartment); 
			       sheet.addCell(number);
			       // Men
			       number = new Number(col+3, j+dep, lines[n].getCntMenDep(), cellDepartment); 
			       sheet.addCell(number);
			       // Women
			       number = new Number(col+4, j+dep, lines[n].getCntWomenDep(), cellDepartment); 
			       sheet.addCell(number);
			       // Percent
			       label = new Label(col+5, j+dep, lines[n].getPercentMenDep()+" / "+lines[n].getPercentWomenDep(), cellDepartment);
			       sheet.addCell(label);
		    	   dep++;
	    	   }   
	    	 
	    	 sheet.setRowView(j+dep, 550);
	    	 // #
	    	 number = new Number(cellStart.getC(), j+dep, num, borderStyle); 
	    	 sheet.addCell(number);
	    	 //	job name
	    	 label = new Label(col+1, j+dep, lines[n].getJob(),jobStyle);
	    	 sheet.addCell(label);
	    	 // Count Job
	    	 number = new Number(col+2, j+dep, lines[n].getCntJob(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Men
	    	 number = new Number(col+3, j+dep, lines[n].getCntMenJob(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Women
	    	 number = new Number(col+4, j+dep, lines[n].getCntWomenJob(), borderStyle); 
	    	 sheet.addCell(number);
	    	 //	Percent Job
	    	 label = new Label(col+5, j+dep, lines[n].getPercentMenJob()+" / "+lines[n].getPercentWomenJob(), borderStyle);
	    	 sheet.addCell(label);
	    	 
	    	 rowC = j+dep;
	    	 n++;
	    	 num++;
	    }
	    
	    //---> Total
	    rowC++;
	    if(HR_Department_ID == 0){
	    	
	    	sheet.mergeCells(col, rowC, col+1, rowC);
	    	sheet.setRowView(rowC, 700);
	    	// Total
	    	label = new Label(col, rowC, "ИТОГО", totalStyle); 
		    sheet.addCell(label);
			//	Count company
		   	number = new Number(col+2, rowC, lines[0].getCntCompany(), totalStyle); 
		   	sheet.addCell(number);                  
		   	//	Count Men                 
		   	number = new Number(col+3, rowC, lines[0].getCntMen(), totalStyle); 
		   	sheet.addCell(number);                  
		   	//	Count Women                  
		   	number = new Number(col+4, rowC, lines[0].getCntWomen(), totalStyle); 
		   	sheet.addCell(number);   
		   	// Percent Company
	    	label = new Label(col+5, rowC, lines[0].getPercentMen()+" / "+lines[0].getPercentWomen(), totalStyle);
	    	sheet.addCell(label);

	    	// Diagram
		   	formula = new Formula(col+3, 1, sheet.getName()+"!E"+(rowC+1));
			sheet1.addCell(formula);
			formula = new Formula(col+4, 1, sheet.getName()+"!F"+(rowC+1));
			sheet1.addCell(formula);
	    }else{
	    	// Diagram
		   	formula = new Formula(col+3, 1, sheet.getName()+"!E7");
			sheet1.addCell(formula);
			formula = new Formula(col+4, 1, sheet.getName()+"!F7");
			sheet1.addCell(formula);
	    }
	   	// <---
	    
	    
	    if(HR_Block_ID == 0 && HR_Department_ID == 0)
	    	sheet.removeRow(2);
	    
	    copy.write();
	    copy.close();
	    tableBook.close();
	    temporaryFile.delete();
	       
		// Open the file with the application associated
		String fileName = fullPath.toString();
		Util.launchFile(new File(fileName));
				
		return Msg.translate(m_ctx, "Success");
	}
	
	private Sex[] getValues(){
		
		Sex values = new Sex();
		List<Sex> list = new ArrayList<Sex>();
		PreparedStatement pstmt = null;
		ResultSet rs = null;		
				
		try
		{
			pstmt = DB.prepareStatement(getSql(),null);
			if (HR_Department_ID != 0){
				pstmt.setInt(1, HR_Department_ID);
			}
			else if(HR_Block_ID !=0){
				pstmt.setInt(1, HR_Block_ID);
				
			}
			rs = pstmt.executeQuery();	
					
			while (rs.next ())
			{
				values = new Sex();
				values.setDepartment_id(rs.getInt(1));
				values.setDepartment(rs.getString(2));
				values.setJob_id(rs.getInt(3));
				values.setJob(rs.getString(4));
				values.setCntMenDep(rs.getInt(5));
				values.setCntMenJob(rs.getInt(6));
				values.setCntWomenDep(rs.getInt(7));
				values.setCntWomenJob(rs.getInt(8));
				values.setCntCompany(rs.getInt(9));
				values.setCntMen(rs.getInt(10));
				values.setCntWomen(rs.getInt(11));
				values.setPercentMenDep(rs.getInt(12));
				values.setPercentWomenDep(rs.getInt(13));
				values.setPercentMenJob(rs.getInt(14));
				values.setPercentWomenJob(rs.getInt(15));
				values.setCntDep(rs.getInt(16));
				values.setCntJob(rs.getInt(17));
				values.setPercentMen(rs.getInt(18));
				values.setPercentWomen(rs.getInt(19));
				list.add(values);
			}
		}
		catch (SQLException e)
		{
			log.log(Level.SEVERE, "product", e);
		}
		finally
		{
			DB.close(rs, pstmt);
			rs = null; pstmt = null;
		}	
		
		return list.toArray(new Sex[list.size()]);
	}
	
	private String getSql(){
		
		String sql_ =  "WITH T1 AS (SELECT T.HR_DEPARTMENT_ID AS DEPARTMENT_ID, \n"+ 
						"T.NAME AS DEPARTMENT, \n"+ 
						"HD.HR_JOB_ID AS JOB_ID, \n"+
						"HD.NAME AS JOB \n"+
						"FROM HR_DEPARTMENT T \n"+ 
						"JOIN HR_JOB HD ON HD.HR_DEPARTMENT_ID=T.HR_DEPARTMENT_ID AND HD.ISACTIVE='Y' \n"+ 
						"LEFT JOIN HR_EMPLOYEE R ON R.HR_DEPARTMENT_ID=T.HR_DEPARTMENT_ID AND R.ISACTIVE='Y' \n " +
						"AND R.ENDDATE = (SELECT MAX(TT.ENDDATE) FROM HR_EMPLOYEE TT WHERE TT.C_BPARTNER_ID=R.C_BPARTNER_ID) \n" +
						"WHERE T.ISACTIVE='Y' \n";

		StringBuffer sql = new StringBuffer(sql_);
		if (HR_Department_ID != 0){
			sql.append(" AND T.HR_DEPARTMENT_ID=? \n");
			param.add(HR_Department_ID);
		}
		else if(HR_Block_ID !=0){
			sql.append(" AND T.HR_DEPARTMENT_ID IN (SELECT NODE_ID FROM AD_TREENODEDEP WHERE PARENT_ID=?) \n");
			param.add(HR_Block_ID);
			
		}
		sql.append("GROUP BY T.HR_DEPARTMENT_ID, HD.HR_JOB_ID \n  ORDER BY T.HR_DEPARTMENT_ID, HD.HR_JOB_ID \n ), \n");
		sql.append("T2 AS( \n"+
					"SELECT A.*, ( \n"+
						"SELECT COUNT(*)::numeric(3,1) FROM HR_EMPLOYEE R WHERE  R.HR_DEPARTMENT_ID=A.DEPARTMENT_ID AND R.ISACTIVE='Y' AND R.HRM_SEX='M' \n " +
						"AND R.ENDDATE = (SELECT MAX(TT.ENDDATE) FROM HR_EMPLOYEE TT WHERE TT.C_BPARTNER_ID=R.C_BPARTNER_ID)  \n"+
					") AS CNT_MEN_DEP, \n");
		sql.append("( \n "+
						"SELECT COUNT(*)::numeric(3,1) FROM HR_EMPLOYEE R WHERE  R.HR_JOB_ID=A.JOB_ID AND R.ISACTIVE='Y' AND R.HRM_SEX='M' \n " +
						"AND R.ENDDATE = (SELECT MAX(TT.ENDDATE) FROM HR_EMPLOYEE TT WHERE TT.C_BPARTNER_ID=R.C_BPARTNER_ID)  \n "+ 
						") as CNT_MEN_JOB FROM T1 A \n");
		sql.append("), \n T3 AS( \n"+
					"SELECT B.*, ( \n"+
						"SELECT COUNT(*)::numeric(3,1) FROM HR_EMPLOYEE R WHERE  R.HR_DEPARTMENT_ID=B.DEPARTMENT_ID AND R.ISACTIVE='Y' AND R.HRM_SEX='W' \n" +
						"AND R.ENDDATE = (SELECT MAX(TT.ENDDATE) FROM HR_EMPLOYEE TT WHERE TT.C_BPARTNER_ID=R.C_BPARTNER_ID)  \n"+
					") AS CNT_WOMEN_DEP, \n");
		sql.append("( \n "+
						"SELECT COUNT(*)::numeric(3,1) FROM HR_EMPLOYEE R WHERE  R.HR_JOB_ID=B.JOB_ID AND R.ISACTIVE='Y' AND R.HRM_SEX='W' \n" +
						"AND R.ENDDATE = (SELECT MAX(TT.ENDDATE) FROM HR_EMPLOYEE TT WHERE TT.C_BPARTNER_ID=R.C_BPARTNER_ID)  \n "+ 
						") as CNT_WOMEN_JOB FROM T2 B), \n");
		sql.append("T4 AS ( \n"+
					 "SELECT C.*, ( \n"+
					 "SELECT COUNT(*)::numeric(3,1) FROM HR_EMPLOYEE R WHERE  R.ISACTIVE='Y' AND R.HRM_SEX IS NOT NULL \n");
		
		if(HR_Department_ID == 0 && HR_Block_ID != 0){
			sql.append(" AND R.HR_DEPARTMENT_ID IN (SELECT NODE_ID FROM AD_TREENODEDEP WHERE PARENT_ID="+HR_Block_ID+") \n");
		}
					 
		sql.append("AND R.ENDDATE = (SELECT MAX(TT.ENDDATE) FROM HR_EMPLOYEE TT WHERE TT.C_BPARTNER_ID=R.C_BPARTNER_ID) \n"+  
					 ") as CNTCOMPANY FROM T3 C \n"+
					 "), \n"+
					 "T5 AS ( \n"+
					 "SELECT D.*, ( \n"+
					 "SELECT COUNT(*)::numeric(3,1) FROM HR_EMPLOYEE R WHERE  R.ISACTIVE='Y' AND R.HRM_SEX='M' \n");
		
		if(HR_Department_ID == 0 && HR_Block_ID != 0){
			sql.append(" AND R.HR_DEPARTMENT_ID IN (SELECT NODE_ID FROM AD_TREENODEDEP WHERE PARENT_ID="+HR_Block_ID+") \n");
		}
		
		sql.append("AND R.ENDDATE = (SELECT MAX(TT.ENDDATE) FROM HR_EMPLOYEE TT WHERE TT.C_BPARTNER_ID=R.C_BPARTNER_ID) \n"+  
					 ") as CNTMEN FROM T4 D \n"+
					 "), \n"+
					 "T6 AS ( \n"+
					 "SELECT E.*, ( \n"+
					 "SELECT COUNT(*)::numeric(3,1) FROM HR_EMPLOYEE R WHERE  R.ISACTIVE='Y' AND R.HRM_SEX='W' \n");
		
		if(HR_Department_ID == 0 && HR_Block_ID != 0){
			sql.append(" AND R.HR_DEPARTMENT_ID IN (SELECT NODE_ID FROM AD_TREENODEDEP WHERE PARENT_ID="+HR_Block_ID+") \n");
		}
		
		sql.append("AND R.ENDDATE = (SELECT MAX(TT.ENDDATE) FROM HR_EMPLOYEE TT WHERE TT.C_BPARTNER_ID=R.C_BPARTNER_ID) \n"+  
					 ") as CNTWOMEN FROM T5 E) \n");
		sql.append("SELECT T.*, \n"+
						 "CASE WHEN CNT_MEN_DEP != 0 OR CNT_WOMEN_DEP != 0 THEN ROUND(CNT_MEN_DEP/(CNT_MEN_DEP+CNT_WOMEN_DEP)*100) ELSE 0 END AS PERCENT_MEN, \n"+
						 "CASE WHEN CNT_MEN_DEP != 0 OR CNT_WOMEN_DEP != 0 THEN ROUND(CNT_WOMEN_DEP/(CNT_MEN_DEP+CNT_WOMEN_DEP)*100) ELSE 0 END AS PERCENT_WOMEN, \n" +
						 "CASE WHEN CNT_MEN_JOB != 0 OR CNT_WOMEN_JOB != 0 THEN ROUND(CNT_MEN_JOB/(CNT_MEN_JOB+CNT_WOMEN_JOB)*100) ELSE 0 END AS PERCENT_MEN_JOB, \n" +
						 "CASE WHEN CNT_MEN_JOB != 0 OR CNT_WOMEN_JOB != 0 THEN ROUND(CNT_WOMEN_JOB/(CNT_MEN_JOB+CNT_WOMEN_JOB)*100) ELSE 0 END AS PERCENT_WOMEN_JOB, \n" +
						 "(CNT_MEN_DEP+CNT_WOMEN_DEP) AS CNTDEP, \n"+
						 "(CNT_MEN_JOB+CNT_WOMEN_JOB) AS CNTJOB, \n" +
						 "CASE WHEN CNTCOMPANY != 0 THEN ROUND((CNTMEN/CNTCOMPANY)*100)  ELSE 0 END AS PERCENTMEN, \n"+
						 "CASE WHEN CNTCOMPANY != 0 THEN ROUND((CNTWOMEN/CNTCOMPANY)*100)  ELSE 0 END AS PERCENTWOMEN \n"+
						 "FROM T6 t ");
		
		return sql.toString();
	}
	
	class Sex{
			
			private int department_id;
			private String department;
			private int job_id;
			private String job;
			private int cntMenDep;
			private int cntMenJob;
			private int cntWomenDep;
			private int cntWomenJob;
			private int cntCompany;
			private int cntMen;
			private int cntWomen;
			private int PercentMenDep;
			private int PercentWomenDep;
			private int PercentMenJob;
			private int PercentWomenJob;
			private int cntDep;
			private int cntJob;
			private int PercentMen;
			private int PercentWomen;
			
			public int getDepartment_id() {
				return department_id;
			}
			public void setDepartment_id(int department_id) {
				this.department_id = department_id;
			}
			public String getDepartment() {
				return department;
			}
			public void setDepartment(String department) {
				this.department = department;
			}
			public int getJob_id() {
				return job_id;
			}
			public void setJob_id(int job_id) {
				this.job_id = job_id;
			}
			public String getJob() {
				return job;
			}
			public void setJob(String job) {
				this.job = job;
			}
			public int getCntMenDep() {
				return cntMenDep;
			}
			public void setCntMenDep(int cntMenDep) {
				this.cntMenDep = cntMenDep;
			}
			public int getCntMenJob() {
				return cntMenJob;
			}
			public void setCntMenJob(int cntMenJob) {
				this.cntMenJob = cntMenJob;
			}
			public int getCntWomenDep() {
				return cntWomenDep;
			}
			public void setCntWomenDep(int cntWomenDep) {
				this.cntWomenDep = cntWomenDep;
			}
			public int getCntWomenJob() {
				return cntWomenJob;
			}
			public void setCntWomenJob(int cntWomenJob) {
				this.cntWomenJob = cntWomenJob;
			}
			public int getCntCompany() {
				return cntCompany;
			}
			public void setCntCompany(int cntCompany) {
				this.cntCompany = cntCompany;
			}
			public int getCntMen() {
				return cntMen;
			}
			public void setCntMen(int cntMen) {
				this.cntMen = cntMen;
			}
			public int getCntWomen() {
				return cntWomen;
			}
			public void setCntWomen(int cntWomen) {
				this.cntWomen = cntWomen;
			}
			public int getPercentMenDep() {
				return PercentMenDep;
			}
			public int getPercentWomenDep() {
				return PercentWomenDep;
			}
			public void setPercentWomenDep(int percentWomenDep) {
				PercentWomenDep = percentWomenDep;
			}
			public int getPercentMenJob() {
				return PercentMenJob;
			}
			public void setPercentMenJob(int percentMenJob) {
				PercentMenJob = percentMenJob;
			}
			public int getPercentWomenJob() {
				return PercentWomenJob;
			}
			public void setPercentWomenJob(int percentWomenJob) {
				PercentWomenJob = percentWomenJob;
			}
			public void setPercentMenDep(int percentMenDep) {
				PercentMenDep = percentMenDep;
			}
			public int getCntDep() {
				return cntDep;
			}
			public void setCntDep(int cntDep) {
				this.cntDep = cntDep;
			}
			public int getCntJob() {
				return cntJob;
			}
			public void setCntJob(int cntJob) {
				this.cntJob = cntJob;
			}
			public int getPercentMen() {
				return PercentMen;
			}
			public void setPercentMen(int percentMen) {
				PercentMen = percentMen;
			}
			public int getPercentWomen() {
				return PercentWomen;
			}
			public void setPercentWomen(int percentWomen) {
				PercentWomen = percentWomen;
			}
	}

}
